import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;

public class Text {
    
    public static void main20(String[] args) {
        int[] array1 = {1,2,34,3,4,5,7,23,12};
        int[] array2 = {2,6,4,1};
        System.out.println(text6(array1));
        System.out.println(text6(array2));
    }
    public static boolean text6(int[] array) {
        int i = 0;
        while(i < array.length) {
            int count = 0;
            if(array[i] % 2 != 0) {
                int j = i;
                while(j < array.length && array[j] % 2 != 0) {
                    count++;
                    j++;
                }
                if(count >= 3) {
                    return true;
                }
            }
            i++;
        }
        return false;
    }
    public static void main19(String[] args) {
        int[] array = {2,2,1,1,1,2,2};
        Arrays.sort(array);
        System.out.println(array[array.length / 2]);
    }
    public static void main18(String[] args) {
        int[] array = {2,2,1};
        text5(array);
        int[] array2 = {4,1,2,1,2};
        text5(array2);
    }
    public static void text5(int[] array) {
        for(int i = 0;i < array.length;i++) {
            int count = 0;
            for(int j = 0;j < array.length;j++) {
                if(array[i] == array[j]) {
                    count++;
                }
            }
            if(count == 1) {
                System.out.println(array[i]);
                return;
            }
        }
    }
    public static void main17(String[] args) {
        int[] array = {2,9,11,15,2,7,6};
        int n = 9;
        int[] arr = text4(array, n);
        for(int x : arr) {
            System.out.print(x + " ");
        }
    }
    public static int[] text4(int[] array,int n) {
        int[] arr = {-1,-1};
        for(int i = 0;i < array.length - 1;i++) {
            int j = i+1;
            while(j < array.length) {
                if(array[i] + array[j] == n) {
                    arr[0] = i;
                    arr[1] = j;
                    return arr;
                }
                j++;
            }
        }
        return arr;
    }
    public static void main16(String[] args) {
        int[] array = {1,2,3,4,5,6};
        int len = array.length - 1;
        int i = 0;
        while(i < len) {
            while(i < len && array[i] % 2 != 0) {
                i++;
            }
            while(i < len && array[len] % 2 != 1) {
                len--;
            }
            swap(array,i,len);
        }
        for (int x: array) {
            System.out.print(x + " ");
        }
    }
    public static void swap(int[] array,int i,int len) {
        int tmp = array[i];
        array[i] = array[len];
        array[len] = tmp;
    }

    public static void main15(String[] args) {
        int[] array = {1,2,3};
        transform(array);
        for (int x:array) {
            System.out.print(x + " ");
        }
    }
    public static void transform(int[] array) {
        for(int i = 0;i < array.length;i++) {
            array[i] = array[i] * 2;
        }
    }
    public static void main14(String[] args) {
        int n = 3;
        hanno(n,'A','B','C');
    }
    public static void hanno(int n,char a,char b,char c) {
        if(n == 1) {
            System.out.println(a + "->" + c);
        }else {
            hanno(n - 1,a,c,b);
            System.out.println(a + "->" + c);
            hanno(n - 1,b,a,c);
        }
    }
    public static void main13(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        System.out.println(text3(n));
    }
    public static int text3(int n) {
        if(n == 1 || n == 2) {
            return 1;
        }
        return  text3(n-1) + text3(n - 2);
    }



    public static void main12(String[] args) {
        int n = 235;
        System.out.println(text2(n));
    }
    public static int text2(int n) {
        if(n < 10) {
            return n;
        }else {
            return n % 10 + text2(n / 10);
        }
    }



    public static void main11(String[] args) {
        int n = 1234;
        text(n);
    }
    public static void text(int n) {
        if(n < 10) {
            System.out.println(n);
        }else {
            text(n / 10);
            System.out.println(n % 10);
        }
    }

    public static void main10(String[] args) {
        int n = 10;
        System.out.println(sum1(n));
    }
    public static int sum1(int n) {
        if(n == 1) {
            return 1;
        }
        return n + sum1(n - 1);
    }




    public static void main9(String[] args) {
        int n = 5;
        System.out.println(jiecheng(n));
    }
    public static int jiecheng(int n) {
        if(n == 1) {
            return 1;
        }
        return n * jiecheng(n - 1);
    }


    public static void main8(String[] args) {
        System.out.println(myMax(5, 6));
        System.out.println(myMax(5.0, 6.0,2.0));
    }
    public static int myMax(int a,int b) {
        return a > b ? a : b;
    }
    public static double myMax(double a,double b,double c) {
        a = a > b ? a : b;
        return a > c ? a : c;
    }
    public static void main7(String[] args) {
        System.out.println(sum(5,9));
        System.out.println(sum(1.5,2.8,3.4));
    }
    public static int sum(int a,int b) {
        return a + b;
    }
    public static double sum(double f1,double f2,double f3) {
        return f3 + f2 + f1;
    }





    public static void main6(String[] args) {
        Random random = new Random();
        Scanner scanner = new Scanner(System.in);
        int c = -1;
        int n = random.nextInt(101);
        while(true) {
            System.out.println("请输入0 - 100 的数字");
            c = scanner.nextInt();
            if(c > n) {
                System.out.println("大了");
            }else if(c < n) {
                System.out.println("小了");
            }else {
                System.out.println("回答正确");
                break;
            }
        }
    }
    public static void main5(String[] args) {
        double sum = 0;
        for(int i = 1; i <= 100; i++) {
            if(i % 2 == 0) {
                sum -= 1.0/i;
            }else {
                sum += 1.0/i;
            }
        }
        System.out.println(sum);
    }

    public static void main4(String[] args) {
        String str1 = "abcd";
        Scanner scanner = new Scanner(System.in);
        for(int i = 2; i >= 0; i--) {
            System.out.println("请输入密码");
            String str2 = scanner.nextLine();
            if(str2.equals(str1)) {
                System.out.println("输入正确");
                break;
            }else {
                System.out.println("输入错误，还剩" + i + "次机会");
            }
        }
    }

    public static void main3(String[] args) {
        int n = 123;
        while(n > 0) {
            System.out.print(n % 10 + " ");
            n = n /10;
        }
    }
    public static void main2(String[] args) {
        //System.out.println(max2( 2, 3));
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int a = 1;
        int b = 1;
        int c = 1;
        while(n > 2) {
            c = a + b;
            a = b;
            b = c;
            n--;
        }
        System.out.println(c);
    }



    public static int max2(int a ,int b) {
        return a > b ? a : b;
    }
    public static int max3(int a ,int b,int c) {
        a = max2(a,b);
        return max2(a,c);
    }
}
